package com.shuqi.model.parse.parser;

import java.util.ArrayList;
import java.util.List;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

import com.shuqi.model.parse.HandlerBase;

/**
 * 公告解析器
 * 
 * @author chenwei
 * 
 */
public class NoticeParser extends HandlerBase {

    private List<String> noticeInfo;

    @Override
    public Object getParsedData() {
        return noticeInfo;
    }

    @Override
    public void startDocument() throws SAXException {
        super.startDocument();
        noticeInfo = new ArrayList<String>();
    }

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes)
            throws SAXException {
        if (localName.equals("Notice")) {
            String notice = isNull(attributes, "content");
            noticeInfo.add(notice);
        }
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        super.characters(ch, start, length);
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        super.endElement(uri, localName, qName);
    }

    @Override
    public void endDocument() throws SAXException {
        super.endDocument();
    }
}
